﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace ElectrosLtdApplication.Models
{
    public class RegisterModel
    {
        [Required(ErrorMessage = "Username is required")]
        public string Username { get; set; }

        [Required(ErrorMessage = "Password is required")]
        [StringLength(50, MinimumLength = 6, ErrorMessage = "Minimum length should be 6 characters")]
        public string Password { get; set; }

        [Required(ErrorMessage = "PIN is required")]
        [RegularExpression("^[0-9]{4}$", ErrorMessage = "Enter a 4-digit pin")]
        public int PIN { get; set; }

        [Required(ErrorMessage = "Email is required")]
        [RegularExpression(@"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}", ErrorMessage = "Email is in incorrect format")]
        public string Email { get; set; }

        [Required(ErrorMessage = "Name is required")]
        public string Name { get; set; }

        [Required(ErrorMessage = "Surname is required")]
        public string Surname { get; set; }

        [Required(ErrorMessage = "Residence is required")]
        public string Residence { get; set; }

        [Required(ErrorMessage = "Street is required")]
        public string Street { get; set; }

        [Required(ErrorMessage = "Town is required")]
        public string Town { get; set; }

        [Required(ErrorMessage = "Country is required")]
        public string Country { get; set; } //not sure if string or List<String>

        [Required(ErrorMessage = "Mobile number is required")]
        [RegularExpression("^[0-9]+$", ErrorMessage = "Only digits are accepted")]
        public string Mobile { get; set; }
    }
}